'''
https://leetcode.cn/problems/count-the-repetitions/
'''
import math


class Solution:
    def getMaxRepetitions(self, s1: str, n1: int, s2: str, n2: int) -> int:
        cnt1 = [0]* 26
        cnt2 = [0]* 26
        for c in s1:
            cnt1[ord(c) - ord('a')] += n1
        for c in s2:
            cnt2[ord(c) - ord('a')] += n2

        res = float('inf')
        for i in range(26):
            if cnt2[i]:
                res = min(res, cnt1[i] // cnt2[i])
        return 0 if res == float('inf') else res




v = 10 ** 8
print(math.log2(v))